<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text">
    <script>
        let input = document.querySelector('input');
        // input.onfocus = function () {
        //     console.log('获取焦点');
        // }
        // input.onblur = function () {
        //     console.log('失去焦点');
        // }
        input.onchange = function () {
            console.log(this.value);
        }
        // input.oninput = function () {
        //     console.log('a');
        // }
    </script>
</body>

</html>